<?php

namespace App\Containers\AppSection\BankDetail\Traits;

use App\Containers\AppSection\BankDetail\Tasks\FindBankDetailByIdTask;

trait IsOwnerProfileTrait
{
    public function isOwnerProfile(): bool
    {
        $bankDetail = app(FindBankDetailByIdTask::class)->run($this->id);

        return $this->profile()->id === $bankDetail->profile->id;
    }
}
